home *** CD-ROM | disk | FTP | other *** search
/ LOGIC Apps / Logic-APPLE_II_APPS.iso / mac / LOGIC Apple II 5.25" Library - ProDOS / PRO027A.dsk / FREEPRI.DOC.txt < prev    next >
Text File  |  2012-02-16  |  28KB  |  520 lines

  1.  
  2.                             F R E E P R I N T E R 
  3.                          Documentation for Version 2.7
  4.  
  5.                          by Elliot Lifson [72767,3352]
  6.                                 NINCOMPUTE LTD.
  7.  
  8. This program is presented as a machine language alternative to the "PRINT.LUTUS" program elsewhere. It was designed to work as a text printer to accompany Paul Lutus' FREEWRITER program.  While performing the functions of the PRINT.LUTUS program, it also supports many of the APPLEWRITER imbedded print commands, which adds to its usefulness. In addition, it can be used as a quick screen or printer dump for sequential text files (which was my original intent when writing it, oddly enough. It grew, sort of!)
  9.  
  10. This is a revision to add some enhancements and features based on requests of
  11. people using the earlier program. Specifically, there is now a "Line
  12. Interval" parameter, used for skipping lines. The speed of the scrolling
  13. display can be varied while scrolling (a feature found in ASCII Express which
  14. is too handy to ignore). The BASIC.SYSTEM interface is more bullet proof. The
  15. title display is only done once, so that you can catalog a directory and
  16. still see the filenames while typing one in. Finally, I've traded the CTRL-C
  17. key for the Escape Key to abort the program, as it appears to be more of a
  18. standard. 
  19.  
  20. The program resides between $8000 and $8FCF, and uses $9000-$90FF as a
  21. utility buffer. There are two buffer areas into which text is loaded before
  22. it is formatted and displayed. The buffers are contiguous, and as FREEPRINTER
  23. is supplied they occupy $F00-$7FFF; however, this space can be reduced to one
  24. as small as $300 bytes. Thus, FREEPRINTER could conceivably be co-resident
  25. with a rather large Applesoft program, as long as HIMEM is set correctly.
  26.  
  27.  
  28.                              TO USE FREEPRINTER
  29.  
  30. The binary file FREEPRINTER is not a SYSTEM file and should be BRUN from the Applesoft prompt. (The "-" DASH command may be used, of course.)
  31.  
  32. BRUNning the program will initialize the Ampersand Vector, and start the
  33. program. After exiting, an Ampersand (&) from the keyboard will restart the
  34. program for further passes, without modifying the printer parameters you have
  35. established. All characters after the Ampersand will be ignored, except for
  36. an uppercase "Q" which will restore the original contents of the Ampersand
  37. Vector and terminate the program.
  38.  
  39. The program will prompt you for the name of a textfile. Normal ProDOS
  40. protocol is used here; the prefix will be retrieved if you don't supply one,
  41. and created from the default slot & drive if ProDOS doesn't have one stored
  42. away. A null entry will return you to Applesoft. As a time-saver for repeated
  43. use, entering an equal sign ("=") instead of a filename will cause the
  44. program to use the last filename you entered, recovered from its buffer at
  45. $9000. The program will test the validity of a stored pathname, and if the
  46. pathname is not valid you will have to re-enter the pathname from scratch.
  47.  
  48. Note that the program checks to make sure that your filename refers to a text
  49. file. Currently, only normal TXT files (ID byte = $04) are supported, but you
  50. may add whatever file types you like to this list. (See the section on
  51. CUSTOMIZING, below.)
  52.  
  53. The program then loads your text file (or as much of it as it can fit into
  54. its main buffer), and displays the default printer parameters. We will
  55. discuss the parameters and how to set them in the section on PARAMETERS,
  56. below; however, to accept the parameters, press the <RETURN> key. 
  57.  
  58. You are then given a final chance to change your mind. Press a "Y" to
  59. indicate that all is okay. Then you are given a few on-screen reminders: a
  60. keypress will freeze and restart the display, and the ESC key will abort the
  61. listing. If you are not printing (printing is defined as output to a slot
  62. other than 0 or 3), provision is made to slow the rate of the screen dump;
  63. pressing the "." key speeds up the display, while pressing "," slows it down.
  64. At boot-time, FREEPRINTER is set to screen-dump somewhat slower than full
  65. speed.
  66.  
  67. After the file has been dumped, a press of any key will return you to
  68. Applesoft, with 80-column firmware off and all files closed.
  69.  
  70.  
  71.  
  72.                               PARAMETERS OVERVIEW
  73.  
  74. The parameters are pretty straight forward. The default is my idea of a quick
  75. screen dump of a textfile: Left margin = 0, Right margin = 78, Output to Slot
  76. 3, and Page Interval = 0.
  77.  
  78. To change a parameter from the menu, merely type in its two-letter mnemonic
  79. followed by an argument, if required. All numeric arguments are treated
  80. modulo 256; the only time a negative argument is permitted is with the
  81. Paragraph Margin (PM) command. Here, a negative argument less than -128 will
  82. give you strange and wonderful results, but probably not the value you
  83. wanted. 
  84.  
  85. FREEPRINTER uses the 2-letter mnemonics that it does because they correspond
  86. to the traditional APPLEWRITER mnemonics. This lets FREEPRINTER work with
  87. APPLEWRITER documents which may already exist, (perhaps they've been
  88. converted from DOS 3.3) and greatly expands the usefulness of both this
  89. program and the FREEWRITER program. To imbed a printer command in your
  90. document, merely start a paragraph with a period followed by the mnemonic and
  91. argument. Invalid commands and/or anything on the line following a valid
  92. command will be ignored.
  93.  
  94.  
  95.                                    PARAMETERS
  96.  
  97. With the exception of the Paragraph Margin parameter below, all parameters
  98. have absolute value limits of 0 to 255, as they are all 1 byte values. The
  99. Paragraph Margin is a one byte signed value, so it may range from -128 to
  100. +127.
  101.  
  102. LEFT MARGIN (LM) defines the column in which the line's first character is
  103. printed. Practically speaking it won't be greater than 60 or so, and must be
  104. set so the total of LM and PM is at most 5 less than RM, or you will generate
  105. an error. (LM + PM + 5 <= RM)
  106.  
  107. RIGHT MARGIN (RM) defines the last possible column into which the line may
  108. extend. If the margin comes in the middle of a word, the word is moved to the
  109. beginning of the next line. RM must be at least 5 more than LM + PM; this
  110. provides a minimum line length of 5 characters. Please note that if you are
  111. dumping text to screen, a RM of 39 or more (on a 40-column screen) or 79 or
  112. more (on an 80-column screen) will generate an extra carriage return if the
  113. number of characters on that line is 40 or more (or 80 or more), due to the
  114. Monitor routine's automatic scrolling action; therefore, use instead a RM of
  115. 38 (or 78) at these times.
  116.  
  117. (If that seems confusing, remember that FREEPRINTER, like APPLEWRITER, starts
  118. counting screen columns with 0; a left margin of zero and a right margin of
  119. 79 implies that the first character is printed in the first column (column
  120. zero), and the last character in the 80th column (column 79). The auto-scroll
  121. is triggered when printing a character in column 79; so to avoid it, set RM
  122. so the last column printed to is column 78.)
  123.  
  124. PARAGRAPH MARGIN (PM) is the number of spaces added to or subtracted from LM
  125. at the beginning of a new paragraph. (i.e. after a carriage return, or as the
  126. first line of a new document.) PM can be positive or negative; if the sum of
  127. LM and PM equals a number less than zero, printing starts at the left edge of
  128. the page (column zero). As stated above, if LM + PM + 5 exceeds RM, an error
  129. will be generated. The Paragraph Margin is only executed if text is
  130. Left-Justified, (See PRINT MODES, below), but the validity of the value is
  131. always error-checked.
  132.  
  133. EXAMPLE: With a LM of five and PM of 0, each line will begin at column 5,
  134. whether it begins a paragraph or not. With LM=5 and PM=5, the first line of
  135. each paragraph begins at column 10 (5+5=10), with subsequent lines starting
  136. at column 5. If PM is now set to -4, the first line of each paragraph will
  137. start at column 1 (5+(-4)=1), with subsequent lines starting at column 5.
  138. Finally, if pm is set to -6, an error will NOT be generated; the first line
  139. of the paragraph will merely be printed at column zero. (Again, please note
  140. that because the first column is numbered as column zero, column 5 is
  141. actually the 6th column, column 10 is actually the 11th column, etc.) 
  142.  
  143. LINE INTERVAL (LI) is the number of extra lines skipped after each line is
  144. printed. LM=0 implies single spacing, LM=1 implies double spacing, etc.
  145.  
  146. OUTPUT TO WHAT SLOT (Printer Destination, or PD in the APPLEWRITER
  147. convention) is as you would expect it; Slot 0 is the 40-column screen, 3 is
  148. normally for 80-column screens. Output to a slot number greater than 7
  149. generates an error.
  150.  
  151. NOTE: This program is specifically  written for an Apple compatible 80-column
  152. card in the AUX slot; (that is, it prints an ASCII CTRL-U through COUT to
  153. turn off the card.) It should do no harm if the program is run entirely in
  154. 80-column mode, if your card is not compatible. Also, I'll be happy to supply
  155. the source code for this program if anyone would like to modify it for their
  156. own particular 80-column card.
  157.  
  158. N.B. If output is directed to Slot 0 or 3, the program assumes a screen dump
  159. is taking place; if output goes to any other slot, the program assumes it is
  160. feeding a printer. This determines the outcome of certain decisions made at
  161. run-time.
  162.  
  163. A PAGE INTERVAL (PI) of zero forces continuous output; NO PAGE FORMATTING
  164. TAKES PLACE. A non-zero value here defines how many lines there are on your
  165. page (normally 66 for a standard 8-1/2 by 11 page, or 72 lines for 8-1/2 by
  166. 14). If PI is zero, the Page Length (PL), Top Margin (TM), and Top Line (TL
  167. commands will do nothing when dumping text, no matter what they are set for,
  168. and their values are not checked for validity. Also, an imbedded Form Feed
  169. (FF) command will have no effect.
  170.  
  171. PRINTED LINES PER PAGE (PL) determines how many lines of text to print and,
  172. by extension, how many blank lines at the top and bottom of the page. On
  173. every page, half of the difference of PI - PL lines are skipped at the top,
  174. PL lines of text are printed, and half the difference of PI - PL lines are
  175. skipped at the bottom. This will serve to center the number of printed lines
  176. on the page. With this in mind, FREEPRINTER will work best if you position
  177. your printer to start printing at the top line of the first page.
  178.  
  179. EXAMPLE: A PI of 66 and a PL of 60 will first print 3 blank lines at the top
  180. of the page, then a repetition consisting of a sequence of 60 text lines
  181. followed by 6 blank lines (3 for the bottom margin of the current page, 3 for
  182. the top margin of the next page), over and over, until the document is
  183. completed.
  184.  
  185. (NOTE: FREEPRINTER may be modified to skip past the first page's top margin
  186. lines; see the MODIFICATIONS section below.)
  187.  
  188. PL must be set no lower than 3, and no greater than PI, or an error will be
  189. generated.
  190.  
  191. SPACES AFTER TOP LINE (TM, or Top Margin in the APPLEWRITER convention)
  192. provides control over how many lines to skip after the Header line is
  193. printed. (The Header Line, if used, is the first text line printed after the
  194. top-of-form spaces described above in the PL section.) This value may not
  195. exceed PL - 2, or an error will occur. (This guarantees at least one text
  196. line printed per page.) If there is no Header line entered, the TM value is
  197. irrelevant and is not checked for validity.
  198.  
  199. In operation, the Header Line + Spaces after top line + remainder of text on
  200. the page is centered between the top and bottom margins. To expand on the
  201. example above, with a PI of 66 and a PL of 60, adding a TM of 2 with a header
  202. line, each page will consist of three blank lines as margin, then the header,
  203. then two more blank lines, 57 lines of text, and finally three more blank
  204. lines as margin.
  205.  
  206. SINGLE PAGE (SP) lets you use a single sheet printer by prompting you to
  207. insert a new sheet of paper after each page is completed. A zero value
  208. defeats this feature, and a non-zero value enables it. A non-zero value
  209. entered will always be displayed as "1".
  210.  
  211. SCREEN FORMAT (SF, not an APPLEWRITER command) permits you the option of
  212. letting your screen dump ignore or implement imbedded text commands. If the
  213. value is 0, your textfile is dumped to the screen as-is; only the formatting
  214. commands you entered from the menu are in effect. If SF is non-zero, imbedded
  215. commands are implemented, and you can see their affect. Remember though, this
  216. command only affects SCREEN dumps; Printer dumps always do the imbedded
  217. commands. As in the Single Page command, a non-zero SF value is always
  218. displayed as "1".
  219.  
  220. PRINT MODE (LJ/RJ/CJ/FJ): These four commands determine the formatting of
  221. your document. Left Justification (LJ) means all lines start at the left
  222. margin, leaving you a ragged right margin. Right Justification (RJ) means
  223. each line's last character is printed at the right margin, with a ragged left
  224. margin. Center Justification (CJ) means all lines will be centered between
  225. left and right margins, leaving ragged ends on both sides. Full Justification
  226. (FJ) forces extra spaces to be inserted between words to make each line start
  227. at the left margin and end at the right margin. If the line ends in a
  228. carriage return, it is left justified. Remember that Paragraph Margin only
  229. operates in LJ mode.
  230.  
  231. NOTE: If your document has imbedded printer control characters or escape
  232. sequences, a screen dump will display them as inverse characters, but a
  233. printer dump will faithfully transmit them to the printer. Unlike APPLEWRITER
  234. however, when dumping to printer, non-printing characters are taken into
  235. account when justification calculations are made. Therefore, lines containing
  236. underlining commands, for example, will center correctly without need for
  237. special margin settings. As supplied, FREEPRINTER will justify correctly for
  238. all imbedded control characters, and for escape sequences consisting of the
  239. Escape Character followed by one non-control character. (Provision is made
  240. for the user to modify this to the Escape Character followed by two or three
  241. non-control characters; see the section on CUSTOMIZING, below.)
  242.  
  243. The HEADER LINE (TOP LINE, or TL in the APPLEWRITER convention) can be any
  244. character string you would like printed at the top of each page. If the "#"
  245. character is imbedded, the page number will be substituted when the document
  246. is printed. The page number, too, is a one byte value, so after page 255, the
  247. next page is 0. The header line can be centered between LM and RM, or printed
  248. at the left or right margin, depending upon the number of leading asterisks.
  249. One or no leading asterisks forces a left-justified Header line; 2 leading
  250. asterisks causes a centered Header line; 3 or more causes a right-justified
  251. Header line.
  252.  
  253. EXAMPLE: You have a LM of 5 and a RM of 75; you would like the header to say
  254. "PAGE #". Entering TLPAGE # or TL*PAGE # will print the header at column 5;
  255. entering tl**PAGE # will center it between column 5 and column 75  and
  256. TL***PAGE # will print it so the last character is in column 75. You may
  257. optionally insert any number of spaces after the mnemonic, intermixed with
  258. the asterisks, or before the first letter of actual Header text, and they
  259. will be ignored. Unlike APPLEWRITER, you may not have separate texts
  260. justified left, center, and right at the same time; also, unlike APPLEWRITER,
  261. a trailing asterisk will be printed as part of the text.   If the length of
  262. the Header Line (after "#" has been converted to a page number) exceeds
  263. RM-LM, the Header Line will be left-justified despite the number of
  264. asterisks, and it will not wrap at RM; it will continue until the output
  265. device wraps it.
  266.  
  267. If you wish to remove a Header Line entry without replacing it, enter
  268. TL<RETURN>.
  269.  
  270. The FORM-FEED (FF) command doesn't appear on the menu, but is supported as
  271. an imbedded command. This forces the remainder of the current page to be
  272. skipped, and printing resumed at the top of the next page.
  273.  
  274.  
  275.  
  276.                                  ERROR-TRAPPING                              
  277.  
  278. As noted above, bad combinations of parameters will generate an error
  279. message. If the bad parameters are entered from the menu, you will not be
  280. able to exit the menu routine until the errors have been reconciled. However,
  281. this doesn't prevent errors caused by bad imbedded commands. If an error is
  282. generated while a screen dump takes place, execution halts and the
  283. appropriate message is displayed. This is not the case, though, when dumping
  284. to printer.
  285.  
  286. Before printing commences, the current "good" values of parameters are stored
  287. in a memory table. Whenever a single imbedded command (or a block of imbedded
  288. commands in sequence) is executed, the validity of the parameters is
  289. re-checked. If all is okay, the parameters are implemented, and the stored
  290. table of parameters is updated. However, if an error is discovered, no
  291. indication is given; the last-stored table of values is merely reloaded, and
  292. execution continues. This can be confusing if you don't expect it; therefore,
  293. to avoid surprises, it is advisable to dump your document to the screen at
  294. least once before printing it, just to see what (if any) errors ar generated.
  295.  
  296.  
  297.                                   ERROR MESSAGES
  298.  
  299. The following messages may be displayed upon discovery of bad parameter
  300. values:
  301.  
  302.     "At least 5 characters per line."
  303.          This is generated if LM + PM + 5 is greater than RM. If generated   
  304. during a screen-dump, it usually means you re-defined LM too high            
  305. without lowering PM.
  306.  
  307.     "Bad Slot."
  308.          An attempt was made to assign a value greater than 7 to PD.
  309.  
  310.  
  311.          The following 2 errors can only be generated if the value of PI is  
  312. greater than zero.
  313.  
  314.     "Bad PRINTED LINES value."
  315.          This is generated if PL is less than 3 or greater than the value of 
  316. PI.
  317.  
  318.     "Top Margin too large."
  319.          This rarely happens, but is generated if you are running with a very
  320. low PL. Then, if TM is greater than PL-2, no lines of text would be          
  321. printed, just a Header line and skipped spaces; so, an error is              
  322. generated instead.
  323.  
  324. In addition, the message:
  325.  
  326.     "Invalid file type."
  327.  
  328. will occur if the filetype of the file you are trying to load is not on the
  329. internal look-up table. See CUSTOMIZING, immediately following. 
  330.  
  331.                              CUSTOMIZING FREEPRINTER
  332.  
  333. FREEPRINTER was designed to be flexible; there are a number of user-
  334. modifications possible. To implement them, all you need do is BLOAD
  335. FREEPRINTER from Applesoft, enter the Monitor with a CALL -151, and make your
  336. changes. Exit back to Applesoft with 3D0G. Once modified, you may execute
  337. FREEPRINTER immediately by issuing a CALL 32768 (you should not use the
  338. Ampersand command to execute the program until this call has been made at
  339. least once.) Should you decided to make your changes permanent, though, the
  340. command BSAVE FREEPRINTER, A$8000, L$FD0 will accomplish this; none of the
  341. modifications will change the length of the program. You might save your
  342. changed program to a different disk, or under a different filename so that
  343. you can have different versions available for your needs.
  344.  
  345. ADDING FILETYPES: Currently only the ID byte for TXT-type files (ID byte
  346. =$04) is stored in the 5-byte look-up table at memory locations $808B-808F.
  347. There is room for 4 more file-types. Merely poke their ID values into the
  348. table, replacing the zeroes starting at $808C. Use up the zeroes in order; a
  349. zero-byte indicates End-of-Table. (The first byte following the
  350. table--$8090--is the low byte of the address of the Main Buffer; as such, it
  351. should always be zero, and will act as End-of-Table if you really use all
  352. five bytes.) 
  353.  
  354. Note: FREEPRINTER was designed to look only at sequential text files; it
  355. assumes a zero-byte in the file indicates the End-of-File, so looking at a
  356. random text file for instance, would be unrewarding at best.
  357.  
  358. SCREEN DUMP SPEED: The default speed of the screen dump that is in effect
  359. when FREEPRINTER is booted is controlled by the value of the byte at $809E;
  360. the byte's current value is $40. If you would like to have a different
  361. default speed, change this byte: the larger the value, the slower the
  362. display.
  363.  
  364.  DEFAULT PARAMETERS: The display parameters you get when you load FREEPRINTER
  365. are stored in a table starting at $80A8. They are as follows:
  366.  
  367. ADDRESS         PARAMETER        CURRENT VALUE
  368. ______________________________________________
  369. $80A8           Left Margin           $0
  370. $80A9           Right Margin          $4E  (78 decimal)
  371. $80AA           Paragraph Margin      $0
  372. $80AB           Line Interval         $0
  373. $80AC           Printer Destination   $3
  374. $80AD           Page Interval         $0
  375. $80AE           Printed Lines         $0
  376. $80AF           Top Margin            $0
  377. $80B0           Single Page?          $0
  378. $80B1           Screen Format?        $0
  379. $80B2           Print Mode            $0 (LJ=0, RJ=1, CJ=2, FJ=3)
  380.  
  381. In addition, the value of the first page number printed ($1) is stored at
  382. $80F5; this can be made higher if you are printing a document from the
  383. middle.
  384.  
  385. For your own information, the stored pathname starts at $9001 with a length
  386. byte at $9000, and the Top Line is stored at $9081, with a length byte at
  387. $9080.
  388.  
  389. BUFFER SIZE: FREEPRINTER is supplied to use as much memory as possible, for
  390. this reduces the number of disk-drive reads required; as supplied, its main
  391. file buffer starts at $1000, extending to $7FFF. Another page of memory is
  392. always required preceding the main buffer (here $F00 to $FFF). As mentioned
  393. in the introduction, the size of this pair of buffers is variable. To change
  394. it, merely poke the HIGH BYTE of the first page of your buffer in location
  395. $8091. For example, poking $30 into $8091 will force the main buffer to begin
  396. at $3000, with the preceding 1-page buffer at $2F00. All bytes below $2F00
  397. will be untouched. Because of this feature, the possibility exists of using
  398. FREEPRINTER from within a co-resident Applesoft program. FREEPRINTER can
  399. operate successfully with a main buffer as small as 2 pages (poke $7E into
  400. $8091) leaving locations $800 to $7CFF untouched. A co-resident program under
  401. these circumstances would have available $7500 bytes at most.
  402.  
  403. Note 1: Because of ProDOS' general-purpose file buffer, if your co-resident
  404. program makes any kind of disk access at all, or if you even wish to catalog
  405. a disk from immediate mode, HIMEM must be set $400 bytes lower than the
  406. beginning of the 1-page pre-buffer. (Example: Main buffer starting at $7000:
  407. poke $70 into $8091 (POKE 32913,112). The pre-buffer starts at $6F00; HIMEM
  408. should be set for $6B00 (27392 decimal.) FREEPRINTER sets HIMEM for you,
  409. according to whatever buffer space you have selected, and restores HIMEM to
  410. nominal ($9600) upon exiting with the "&Q" command.
  411.  
  412. Note 2: To use FREEPRINTER from a co-resident Applesoft program, you must
  413. BLOAD FREEPRINTER as its first line. (DO NOT DEFINE ANY STRINGS UNTIL AFTER
  414. FREEPRINTER INITIALIZES ITSELF, specifically Control-D's!)  Immediately after
  415. bloading, poke the high byte of the address of the main buffer (should you
  416. wish to change it) into 32913 ($8091, as explained above). Poke 2 into
  417. location 513 ($201, to inform the program that you wish to exit upon
  418. initialization), and CALL 32768 to do the actual initialization.  To print a
  419. file, You must POKE the letters of the COMPLETE pathname of the file
  420. (including LEADING and TRAILING slashes) in "positive" ASCII into the buffer
  421. at $9001, poking the length of the pathname into $9000. Then poke 1 into 513
  422. ($201) to tell the program to skip its routine to get the filename from you,
  423. poke 0 into 36992 ($9080, which performs a minor bit of initialization that
  424. the above poke unfortunately causes to be skipped) and issue an Ampersand.
  425. The following sample code will accomplish this, configuring FREEPRINTER for
  426. its minimum size.
  427.  
  428.           10 PRINT CHR$(4)"BLOAD /VOLUME/FREEPRINTER"
  429.           20 POKE 32913, 126               :  Rem Buffer begins at $7E00.
  430.           30 POKE 513,2                    :  Rem Exit after initialization.
  431.           40 CALL 32768                    :  Rem Initialize program & set
  432.                                               HIMEM.
  433.           Your program goes here. Then, to print a text file:
  434.  
  435.           100 NM$ = "/VOLUME/SUBDIR/MYFILE/"
  436.           110 FOR X = 1 TO  LEN (NM$)
  437.           120 POKE 36864 + X, ASC ( MID$ (NM$,X,1)) : Rem 36864 = $9000
  438.           130 NEXT X
  439.           140 POKE 36864, LEN (NM$)
  440.           150 POKE 513,1                            : Rem   513 = $201
  441.           160 POKE 36992,0                          : Rem 36992 = $9080
  442.           170 &
  443.  
  444. When using this technique, FREEPRINTER is set to skip past all menus and jump
  445. right to the print routine; all non-default parameters should be poked into
  446. place before calling with the ampersand. The routine will exit back to your
  447. program, where you left off.
  448.  
  449. Note that lines 10-40 should only be executed once; repeated attempts to
  450. BLOAD FREEPRINTER will fail, as the bit-map has been marked to show that
  451. memory is occupied in the loading area, and you'll merely generate the
  452. ever-popular NO BUFFERS AVAILABLE error. The exit routine (&Q) will
  453. warm-start ProDOS, and may not be used from within a program, except as the
  454. last line. To use it from within a program, poke 513 with 81 (uppercase "Q")
  455. and issue an ampersand.
  456.  
  457.           500 POKE 513,81
  458.           505 &
  459.  
  460. Note 3: When using FREEPRINTER from within an Applesoft program, all errors
  461. that would result in program termination are directed back into the Applesoft
  462. program, so that normal ONERR GOTO routines will work. For UNTRAPPED errors,
  463. if the generated error is a FREEPRINTER error (as opposed to a ProDOS error),
  464. BASIC.SYSTEM still wants to print one of its own error messages after the
  465. FREEPRINTER error message. So, to avoid confusion caused by two successive
  466. error messages, FREEPRINTER tells BASIC.SYSTEM to display Apple Computer's
  467. copyright notice instead. The error code for any FREEPRINTER-generated error
  468. is 126. ($7E)
  469.  
  470. Note 4: As alluded to above, FREEPRINTER sets the ProDOS Memory Bit-map to
  471. protect itself when loaded. The Bit-map is set during initialization, when
  472. FREEPRINTER is first BRUN. Exiting FREEPRINTER using "&Q" will restore the
  473. Bit-map to its normal configuration. Should you wish FREEPRINTER not to
  474. modify the Bit-map and HIMEM, the following two patches may be used. The
  475. first jumps past the initialization, and the second jumps past the
  476. restoration:
  477.  
  478.    8024:4C BD 80   (replacing 8024:A9 00 A8)
  479.  
  480.    8069:4C 7E 80   (replacing 8046:A9 00 A8)
  481.  
  482. Make these changes only to a COPY of the FREEPRINTER program, not to your
  483. original downloaded version.
  484.  
  485. PAGE BREAKS: As explained above, (when PI is non-zero) FREEPRINTER works
  486. best if your printer is positioned to start at the first line on your first
  487. printed page. This is because lines are skipped at the top of each page to
  488. center the text on the page. It is possible to modify FREEPRINTER to ignore
  489. these skipped lines on the first page of printing, so that you may position
  490. the printer yourself. From the monitor:
  491.  
  492.    8298:EA EA EA
  493.  
  494.    830C:EA EA EA
  495.  
  496. IMBEDDED ESCAPE SEQUENCES: Correct centering and justification is maintained
  497. for imbedded escape sequences consisting of the Escape character and one
  498. non-control character. Because of the wide variety of command structures
  499. required for all the different printers on the market, full support is beyond
  500. the scope of this program. However, if your printer has commands with the
  501. structure of Escape Character followed by two or three non-control
  502. characters, you may modify 6 bytes of code starting at $868A to correct this.
  503. Currently these bytes are NOPs (hex $EA). To permit a second non-control
  504. character, insert (from the Monitor)
  505.  
  506.    868A:CE A3 80
  507.  
  508. For a third character, repeat the sequence at $868D.
  509.  
  510. As mentioned earlier, this program is designed to be flexible. The source
  511. code is rather lengthy, so I've elected not to upload it at the moment. If
  512. you would like to modify FREEPRINTER for your own purposes however, I'd be
  513. happy to make it available. Just drop me an easyplex, or a note on the BB.
  514.  
  515. While the program SHOULD work on any APPLE // that can run ProDOS and display
  516. lower case text, it's only been tested on an enhanced //e with 128k and APPLE
  517. compatible 80 column card. If you have any problems using it on your system,
  518. I'd like to know about it; there could be any number of implementation
  519. details I've overlooked which, if I were aware of, I'd correct.
  520.